package com.easychat.entity.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

@Component
@ConfigurationProperties(prefix = "ws2")
public class WebSocketConfig {

    private List<PortConfig> ports = new ArrayList<>();

    // getter和setter
    public List<PortConfig> getPorts() {
        return ports;
    }

    public void setPorts(List<PortConfig> ports) {
        this.ports = ports;
    }

    // 内部类来存储每个端口的配置
    public static class PortConfig {
        private int port;

        // getter和setter
        public int getPort() {
            return port;
        }

        public void setPort(int port) {
            this.port = port;
        }
    }
}